#import "SolarNostalgicController.h"
        
#import "SolarNostalgicModel.h"
#import "SolarNostalgicCell.h"
#import "Masonry.h"

@interface SolarNostalgicController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *unfoldAmazingJourneyTableView;
@property (nonatomic, strong) NSMutableArray *rippleGrinArray;

@end

@implementation SolarNostalgicController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self blossomVowQuirkInitui];
	[self quaintgetData];
}


- (void)blossomVowQuirkInitui {
    self.unfoldAmazingJourneyTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
    self.unfoldAmazingJourneyTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
    self.unfoldAmazingJourneyTableView.estimatedRowHeight = 0;
    self.unfoldAmazingJourneyTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.unfoldAmazingJourneyTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
    self.unfoldAmazingJourneyTableView.delegate = self;
    self.unfoldAmazingJourneyTableView.dataSource = self;
    self.unfoldAmazingJourneyTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    self.unfoldAmazingJourneyTableView.showsVerticalScrollIndicator = NO;
    self.unfoldAmazingJourneyTableView.showsHorizontalScrollIndicator = NO;
    self.unfoldAmazingJourneyTableView.backgroundColor = UIColor.clearColor;
    [self.unfoldAmazingJourneyTableView registerClass:[SolarNostalgicCell class] forCellReuseIdentifier:NSStringFromClass([SolarNostalgicCell class])];
    [self.view addSubview:self.unfoldAmazingJourneyTableView];
    [self.unfoldAmazingJourneyTableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.equalTo(self.view);
        make.top.equalTo(self.view);
        make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
    }];
}

//: 获取数据模型
- (void)quaintgetData {
	
}

//: 懒加载数据模型数组
- (NSMutableArray *)rippleGrinArray {
	if (!_rippleGrinArray) {
		_rippleGrinArray = [NSMutableArray array];
	}
	return _rippleGrinArray;
}

#pragma mark - UITableView DataSource 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.rippleGrinArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    SolarNostalgicCell *keepsake = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([SolarNostalgicCell class])];
    if (keepsake == nil) {
        keepsake = [[SolarNostalgicCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([SolarNostalgicCell class])];
    }
    keepsake.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return keepsake;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
	SolarNostalgicModel *resonate = self.rippleGrinArray[indexPath.row];
	return resonate.upliftBrillianceCellHeight;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
